from flask import Flask
from flask_redis_ex import redis_client, RedisFlask

app = Flask(__name__)
app.config["REDIS_URL"] = "redis://localhost:6379/0"


RedisFlask(app)


@app.route('/')
def index():
    i = redis_client.get("welcome") or "1"
    redis_client.set("welcome", int(i)+1)
    return i


@app.route('/info')
def info():
    return redis_client.info()


app.run(port=2013, debug=True)
